/*
	The MIT License

	Copyright (c) 2008 IFMO/GameDev Studio

	Permission is hereby granted, free of charge, to any person obtaining a copy
	of this software and associated documentation files (the "Software"), to deal
	in the Software without restriction, including without limitation the rights
	to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
	copies of the Software, and to permit persons to whom the Software is
	furnished to do so, subject to the following conditions:

	The above copyright notice and this permission notice shall be included in
	all copies or substantial portions of the Software.

	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
	THE SOFTWARE.
*/
// i_audiosystem.h - 


#pragma once

///
///	ISound Interface
///	COOL!
///
class ISound{
	public:
	virtual			~ISound				( void ) {};
	
	///	Play
	///	COOL!
	
	virtual void	Play				( void ) = 0;
	///	Pause
	///	COOL!
	virtual void	Pause				( void ) = 0;
	virtual void	Stop				( void ) = 0;
	virtual	void	SetLoop				( bool loop ) = 0;
	virtual	void	SetVolume			( float volume ) = 0;
	virtual	bool	GetLoop				( void ) = 0;
	virtual void	SetOcclusionParams	( float distance_lowpass_range_max, float distance_lowpass_range_min,
										  float distance_lowpass_range_delta ,float max_distance_occlusion ) = 0;
	
	virtual void	SetOcclusion		( float directocclusion, float reverbocclusion ) = 0;
	///
	/// @param	position	-	kills kenny!
	virtual void	SetPosition			( EVec3 &position ) = 0;
	virtual EVec3	GetPosition			( void ) = 0;
	virtual void	SetVelocity			( EVec3 &velocity ) = 0;
	virtual EVec3	GetVelocity			( void ) = 0;
	virtual	void	CalcOcclusion		( EVec3 &listener ) = 0;
	virtual bool	IsPlaying			( void ) = 0;
	virtual void	Occlusion			( bool occlusion ) = 0;
	virtual bool	IsOcclusion			( void ) = 0;
	virtual void	SetDoplerEffect		( float value ) = 0;
	virtual	float	GetDoplerEffect		( void ) = 0;
	virtual void	SetMaxDistance		( float value ) = 0;
	virtual	float	GetMaxDistance		( void ) = 0;
	virtual void	SetMinDistance		( float value ) = 0;
	virtual float	GetMinDistance		( void ) = 0;
	virtual void	SetSpread			( float value ) = 0;
	virtual float	GetSpread			( void ) = 0;
	};

interface	IAudioSystem {
		virtual					~IAudioSystem			( void ) {}
	    virtual ISound          *CreateSound            ( const char *path, bool add_to_group ) = 0;
        virtual void	        Play2DSound				( const char *path, float volume, float panning ) = 0;
        virtual void            SetListener             ( EVec3 &pos, EVec3 &forward, EVec3 &up ) = 0;
        virtual EVec3           GetListener             ( void ) = 0;
        virtual void            UpdateListener          ( EVec3 &pos, EVec3 &forward, EVec3 &up, EVec3 &vel ) = 0;
        virtual void            ReleaseSound            ( ISound * sound ) = 0;
        virtual void            ReleaseAllSounds        ( void ) = 0;
        virtual void            Frame                   ( void ) = 0;
        virtual void            CacheSound              ( const char *path ) = 0;
		virtual void			Update					( void ) = 0;
		virtual void			PlayMusic				( bool fade ) = 0;
		virtual void			PauseMusic				( bool fade ) = 0;
		virtual void			StopMusic				( bool fade ) = 0;
		virtual void			AddSoundMusic			( const char * path ) = 0;
	};	

